package lk.icta.core.web.action;

import lk.icta.common.AppConstants;
import lk.icta.common.dao.GNDivisionDAO;
import lk.icta.common.entity.*;
import lk.icta.common.service.DocumentManagementService;
import lk.icta.common.util.GenderUtil;
import lk.icta.common.web.action.DocumentUploadAction;
import lk.icta.core.dao.*;
import lk.icta.core.entity.*;
import lk.icta.core.service.*;
import lk.icta.user.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

//import java.sql.Date;
import java.util.*;

/**
 * @author Duminda Dharmakeerthi
 * @author Supun Nimesh Karunathilaka
 */
public class LandAction extends DocumentUploadAction {

    private static final Logger logger = LoggerFactory.getLogger(LandAction.class);

    private final LandManagementService landManagementService;
    private final AlienationManagementService alienationManagementService;

    private final GNDivisionDAO gnDivisionDAO;
    private final LandUsageDAO landUsageDAO;
    private final GeologicalTypeDAO geologicalTypeDAO;
    private final BoundaryTypeDAO boundaryTypeDAO;
    private final LocalAuthorityDAO localAuthorityDAO;


    private Map<Integer, String> districtList;
    private Map<Integer, String> dsDivisionList;
    private Map<Integer, String> gnDivisionList;
    private Map<Integer, String> localAuthorityList;
    private Map<Integer, String> landUsageList;
    private Map<Integer, String> geologicalTypeList;
    private Map<Integer, String> alienationTypeList;
    private Map<Integer, String> boundaryTypeList;

    private List<Child> children;
    private List<Alienation> alienationList;
    private List<Schedule> scheduleList;
    private List<Land> landList;

    private int alienationType;
    private int districtId;
    private int dsDivisionId;
    private int gnDivisionId;
    private int localAuthorityId;
    private int permittedLandUsageId;
    private int currentLandUsageId;
    private int geologicalTypeId;
    private long landId;
    private long grantId;
    private long immediateParentId;
    private long alienationId;
    private long occupierId;
    private long childId;

    private Land land;
    private long parentLandRefNumber;
    private Holder holder;
    private Contacts contact;
    private Alienation alienation;
    private LeaseDetail leaseDetail;
    private Mortgage mortgage;
    private Land newLand;
    private Schedule schedule;
    private long tempRefNo;

    private Double hectare;
    private Double acre;
    private Double roods;
    private Double perches;
    private Double landExtent;
    private Double minExtent;
    private Double maxExtent;
    private int alienationMethod;
    private int nicOrRegistrationNo;
    private boolean deedTree;
    private boolean updateMode;
    private boolean updateDetailForm;
    private boolean progress;
    private String page;
    private String mortgageOrTransfer;
    private long[] scheduleLandList;

    private String districtName;
    private String dsDivisionName;
    private String gnDivisionName;
    private String localAuthorityName;
    private String currentLandUsageName;
    private int scheduleId;
    private String geologicalType;
    private String purposeOfLease;
    private String purposeOfLeaseDescription;
    private String presentUsage;
    private String alienationTypeName;
    private String genderName;
    private String calculateLeaseDate;
    private String searchText;


    private boolean viewMode = false;
    private final long MILLIS_IN_A_DAY = 1000 * 60 * 60 * 24;


    public LandAction(LandManagementService landManagementService, GNDivisionDAO gnDivisionDAO,
                      AlienationManagementService alienationManagementService, LandUsageDAO landUsageDAO,
                      DocumentManagementService documentManagementService, GeologicalTypeDAO geologicalTypeDAO,
                      LocalAuthorityDAO localAuthorityDAO, BoundaryTypeDAO boundaryTypeDAO) {
        super(documentManagementService);
        this.landManagementService = landManagementService;
        this.alienationManagementService = alienationManagementService;
        this.gnDivisionDAO = gnDivisionDAO;
        this.landUsageDAO = landUsageDAO;
        this.geologicalTypeDAO = geologicalTypeDAO;
        this.localAuthorityDAO = localAuthorityDAO;
        this.boundaryTypeDAO = boundaryTypeDAO;
    }

    public String loadDetailLandReport() {
        try {
            logger.debug("Load Detailed Land information of {} by {}", getLandId(), getUser().getUsername());
            setUpdateDetailForm(true);
            setLand(landManagementService.getLandByIdUKey(getLandId(), getUser()));

            if (getLand().getAlienationState() != Land.AlienationState.ARCHIVED) {
                setAlienation(alienationManagementService.getActiveAlienationByLandId(getLand().getId(), getUser()));
                populateInitInformation(getUser(), getLand(), getAlienation());
                //Load uploaded supporting documents
                populateUploadedFiles(getLand().getId(), ModuleType.DETAILED_LAND);

                if (getAlienation() == null) {     /* Un-Alienated Land */
                    logger.debug("\n\n\nunAlienated page {}");
                    setPage("unAlienated");
                } else {                      /* Alienated Land */
                    setHolder(getAlienation().getHolder());
                    setContact(getHolder().getContacts());
                    setChildren(getHolder().getChildren());
                    logger.debug("\n--- No of children: {}\n", getChildren().size());
                    logger.debug("\n\n\n\ngetAlienationMethod {}", getAlienation().getAlienationMethod().getId());
                    setAlienationMethod(getAlienation().getAlienationMethod().getId());
                    switch (getAlienation().getAlienationMethod().getId()) {
                        case AppConstants.LAND_PERMIT:     /* Land Permits */
                            setPage("landPermit");
                            break;
                        case AppConstants.LAND_GRANT:     /* Land Grants */
                            setPage("landGrant");
                            setMortgage(getAlienation().getMortgage());
                            setGrantId((getAlienation().getRoot() != null) ? getAlienation().getRoot().getId() : getAlienation().getId());
                            break;
                        case AppConstants.SHORT_TERM_LEASE:     /* Short Term Lease */
                            setPage("shortTermLease");
                            break;
                        case AppConstants.LONG_TERM_LEASE:     /* Long Term Lease */
                            setPage("longTermLease");
                            setLeaseDetail(getAlienation().getLeaseDetail());
                            setMortgage(getAlienation().getMortgage());
                            setGrantId((getAlienation().getRoot() != null) ? getAlienation().getRoot().getId() : getAlienation().getId());
                            break;
                        case AppConstants.RELEASING_TO_DEPARTMENTS:     /* Release to Departments */
                            setPage("releaseToDepartments");
                            break;
                        case AppConstants.VESTING_ORDER:     /* Vesting Order */
                            setPage("vestingOrder");
                            break;
                        case AppConstants.SPECIAL_GRANT:     /* Special Grants */
                            setPage("specialGrant");
                            break;
                    }
                }


                populatePropertyData();
                return getPage();
            } else {
                logger.error("ARCHIVED land cannot be updated");
                return ERROR;
            }
        } catch (Exception e) {
            logger.debug(" Detail Report error :{}", e);
        }

        return ERROR;
    }

    private void populateInitInformation(User user, Land land, Alienation alienation) {
        logger.debug("Populate Basic Lists according to alienation GN Division[user name: {}]", user.getUsername());
        try {
            GNDivision landGN = land.getGnDivision();
            if (AppConstants.ENGLISH.equals(getLanguage())) {
                setDsDivisionName(landGN.getDsDivision().getEnDivisionName());
                setDistrictName(landGN.getDsDivision().getDistrict().getEnDistrictName());
            } else if (AppConstants.SINHALA.equals(getLanguage())) {
                setDsDivisionName(landGN.getDsDivision().getSiDivisionName());
                setDistrictName(landGN.getDsDivision().getDistrict().getSiDistrictName());
            } else if (AppConstants.TAMIL.equals(getLanguage())) {
                setDsDivisionName(landGN.getDsDivision().getTaDivisionName());
                setDistrictName(landGN.getDsDivision().getDistrict().getTaDistrictName());
            }
            //TODO: refactor
            setChildren(new ArrayList<Child>());

            setGnDivisionId(land.getGnDivision().getId());
            setDsDivisionId(land.getGnDivision().getDsDivision().getId());
            if (land.getLocalAuthority() != null) {
                setLocalAuthorityId(land.getLocalAuthority().getId());
            }
            setGeologicalTypeId((land.getGeologicalType() == null ? 0 : land.getGeologicalType().getId()));
            if (alienation != null) {
                setPermittedLandUsageId((alienation.getPermittedUsage() == null) ? 0 : alienation.getPermittedUsage().getId());
                setCurrentLandUsageId((alienation.getCurrentLandUsage() == null) ? 0 : alienation.getCurrentLandUsage().getId());
                if (alienation.getLeaseDetail() != null) {
                    setLeaseDetail(alienation.getLeaseDetail());
                }
            }
            setHectare(land.getLandExtent() * 0.002529285264);

            if (alienation != null && alienation.getAlienationMethod() != null) {
                setLandUsageList(populateLandUsageList(getAlienationType()));
            } else {
                setLandUsageList(populateLandUsageList(0));
            }

            setGeologicalTypeList(geologicalTypeDAO.getAllGeologicalTypes(language, user));
            setBoundaryTypeList(boundaryTypeDAO.getAllBoundaryTypesByUserLanguage(language, user));
            //localAuthorityList = localAuthorityTypeDAO.getAllLocalAuthorities(user.getPrefLanguage(), user);
            //get localAuthority
            DSDivision userDS = this.user.getDsDivisions().iterator().next();
            displayLocalAuthority(userDS.getId());
            setGnDivisionList(gnDivisionDAO.getGNDivisionNamesByDsDivisionId(getDsDivisionId(), language, user));
            setAlienationTypeList(alienationManagementService.getAllAlienationMethods(language, user));
            setBoundaryTypeList(boundaryTypeDAO.getAllBoundaryTypesByUserLanguage(language, user));
            if (alienation == null) {
                setAlienationMethod(0);
            } else {
                setAlienationMethod(getAlienationType());
            }
            findDocumentCategoryList(ModuleType.INITIAL_LAND);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private Map<Integer, String> populateLandUsageList(int alienationMethodId) {
        Map landUsageList = new HashMap<Integer, String>();
        try {
            if (alienationMethodId != 0) {
                Set<LandUsage> landUsage = alienationManagementService.
                        getAlienationMethodById(alienationMethodId, user).getLandUsage();
                for (LandUsage lu : landUsage) {
                    String val = Long.toString(lu.getId());
                    if (AppConstants.ENGLISH.equals(language)) {
                        val = lu.getEnUsageName();
                    } else if (AppConstants.SINHALA.equals(language)) {
                        val = lu.getSiUsageName();
                    } else if (AppConstants.TAMIL.equals(language)) {
                        val = lu.getTaUsageName();
                    }
                    landUsageList.put(lu.getId(), val);
                }
                //  logger.debug("Method :{} Usage :{}", alienation.getAlienationMethod().getId(), landUsage);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            logger.debug("Error", ex);
        }
        return landUsageList;
    }

    public void displayLocalAuthority(int dsDivisionId) {
        //get localAuthority
        List<LocalAuthority> results = localAuthorityDAO.getLocalAuthorityForDSDivisionByDSDivisionId(dsDivisionId, user);
        logger.debug("Auth list {}", results.size());
        setLocalAuthorityList(new HashMap<Integer, String>());
        for (LocalAuthority d : results) {
            if (AppConstants.ENGLISH.equals(language)) {
                getLocalAuthorityList().put(d.getId(), d.getEnName() + " " + d.getLocalAuthorityType().getEnName());

            } else if (AppConstants.SINHALA.equals(language)) {
                getLocalAuthorityList().put(d.getId(), d.getSiName() + " " + d.getLocalAuthorityType().getSiName());

            } else if (AppConstants.TAMIL.equals(language)) {
                getLocalAuthorityList().put(d.getId(), d.getTaName() + " " + d.getLocalAuthorityType().getTaName());

            }

        }
    }

    public void populatePropertyData() {
        DSDivision ds = getLand().getGnDivision().getDsDivision();
        //dsDivisionName = ds.getEnDivisionName();
        setGnDivisionName(getLand().getGnDivision().getGNDivisionNameByLanguage(language));
        //set Local Authority Name
     /*   if (land.getLocalAuthority() != null) {
            if (AppConstants.ENGLISH.equals(language)) {
                localAuthorityName = land.getLocalAuthority().getEnName() + " " + land.getLocalAuthority().getLocalAuthorityType().getEnName();

            } else if (AppConstants.SINHALA.equals(language)) {
                localAuthorityName = land.getLocalAuthority().getSiName() + " " + land.getLocalAuthority().getLocalAuthorityType().getSiName();

            } else if (AppConstants.TAMIL.equals(language)) {
                localAuthorityName = land.getLocalAuthority().getTaName() + " " + land.getLocalAuthority().getLocalAuthorityType().getTaName();

            }
        }  */
        setDsDivisionName(ds.getDSDivisionNameByLanguage(language));
        District dis = ds.getDistrict();
        //districtName = dis.getEnDistrictName();
        setDistrictName(dis.getDistrictNameByLanguage(language));
        if (getLand().getGeologicalType() != null) {
            setGeologicalType(getLand().getGeologicalType().getGeologicalTypeNameByLanguage(language));
        }
        if (getAlienation() != null) {
            if (getAlienation().getPermittedUsage() != null) {
                setPurposeOfLease(getAlienation().getPermittedUsage().getEnUsageName());
            }
            if (getAlienation().getLandUsageDescription() != null) {
                setPurposeOfLeaseDescription(getAlienation().getLandUsageDescription());
            }
            if (getAlienation().getCurrentLandUsage() != null) {
                setPresentUsage(getAlienation().getCurrentLandUsage().getEnUsageName());
            }
            if (getAlienation().getAlienationMethod() != null) {
                setAlienationTypeName(getAlienation().getAlienationMethod().getEnName());
                logger.debug("AlienationTypeName {}", getAlienation().getAlienationMethod().getEnName());

            }
            if (getAlienation().getCurrentLandUsage() != null) {
                setGenderName(GenderUtil.getGender(getAlienation().getHolder().getGender(), language));
            }
        }


        LandUsage landUsage = landUsageDAO.getLandUsageById(getCurrentLandUsageId(), user);
        if (landUsage != null) {
            setCurrentLandUsageName(landUsage.getEnUsageName());
        }

        if (getPermittedLandUsageId() > 0) {
            getAlienation().setPermittedUsage(landUsageDAO.getLandUsageById(getPermittedLandUsageId(), getUser()));
        }
    }

    public String getPresentUsage() {
        return presentUsage;
    }

    public void setPresentUsage(String presentUsage) {
        this.presentUsage = presentUsage;
    }

    public String getAlienationTypeName() {
        return alienationTypeName;
    }

    public void setAlienationTypeName(String alienationTypeName) {
        this.alienationTypeName = alienationTypeName;
    }

    public String getGenderName() {
        return genderName;
    }

    public void setGenderName(String genderName) {
        this.genderName = genderName;
    }

    public String getGeologicalType() {
        return geologicalType;
    }

    public void setGeologicalType(String geologicalType) {
        this.geologicalType = geologicalType;
    }

    public String getPurposeOfLease() {
        return purposeOfLease;
    }

    public void setPurposeOfLease(String purposeOfLease) {
        this.purposeOfLease = purposeOfLease;
    }

    public String getPurposeOfLeaseDescription() {
        return purposeOfLeaseDescription;
    }

    public void setPurposeOfLeaseDescription(String purposeOfLeaseDescription) {
        this.purposeOfLeaseDescription = purposeOfLeaseDescription;
    }

    public Map<Integer, String> getLocalAuthorityList() {
        return localAuthorityList;
    }

    public void setLocalAuthorityList(Map<Integer, String> localAuthorityList) {
        this.localAuthorityList = localAuthorityList;
    }

    public List<Child> getChildren() {
        return children;
    }

    public void setChildren(List<Child> children) {
        this.children = children;
    }

    public int getDsDivisionId() {
        return dsDivisionId;
    }

    public void setDsDivisionId(int dsDivisionId) {
        this.dsDivisionId = dsDivisionId;
    }

    public int getPermittedLandUsageId() {
        return permittedLandUsageId;
    }

    public void setPermittedLandUsageId(int permittedLandUsageId) {
        this.permittedLandUsageId = permittedLandUsageId;
    }

    public int getCurrentLandUsageId() {
        return currentLandUsageId;
    }

    public void setCurrentLandUsageId(int currentLandUsageId) {
        this.currentLandUsageId = currentLandUsageId;
    }

    public Land getLand() {
        return land;
    }

    public void setLand(Land land) {
        this.land = land;
    }

    public Holder getHolder() {
        return holder;
    }

    public void setHolder(Holder holder) {
        this.holder = holder;
    }

    public Alienation getAlienation() {
        return alienation;
    }

    public void setAlienation(Alienation alienation) {
        this.alienation = alienation;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public Map<Integer, String> getDistrictList() {
        return districtList;
    }

    public void setDistrictList(Map<Integer, String> districtList) {
        this.districtList = districtList;
    }

    public Map<Integer, String> getDsDivisionList() {
        return dsDivisionList;
    }

    public void setDsDivisionList(Map<Integer, String> dsDivisionList) {
        this.dsDivisionList = dsDivisionList;
    }

    public Map<Integer, String> getGnDivisionList() {
        return gnDivisionList;
    }

    public void setGnDivisionList(Map<Integer, String> gnDivisionList) {
        this.gnDivisionList = gnDivisionList;
    }

    public Map<Integer, String> getLandUsageList() {
        return landUsageList;
    }

    public void setLandUsageList(Map<Integer, String> landUsageList) {
        this.landUsageList = landUsageList;
    }

    public Map<Integer, String> getGeologicalTypeList() {
        return geologicalTypeList;
    }

    public void setGeologicalTypeList(Map<Integer, String> geologicalTypeList) {
        this.geologicalTypeList = geologicalTypeList;
    }

    public Map<Integer, String> getAlienationTypeList() {
        return alienationTypeList;
    }

    public void setAlienationTypeList(Map<Integer, String> alienationTypeList) {
        this.alienationTypeList = alienationTypeList;
    }

    public Map<Integer, String> getBoundaryTypeList() {
        return boundaryTypeList;
    }

    public void setBoundaryTypeList(Map<Integer, String> boundaryTypeList) {
        this.boundaryTypeList = boundaryTypeList;
    }

    public List<Alienation> getAlienationList() {
        return alienationList;
    }

    public void setAlienationList(List<Alienation> alienationList) {
        this.alienationList = alienationList;
    }

    public List<Schedule> getScheduleList() {
        return scheduleList;
    }

    public void setScheduleList(List<Schedule> scheduleList) {
        this.scheduleList = scheduleList;
    }

    public List<Land> getLandList() {
        return landList;
    }

    public void setLandList(List<Land> landList) {
        this.landList = landList;
    }

    public int getAlienationType() {
        return alienationType;
    }

    public void setAlienationType(int alienationType) {
        this.alienationType = alienationType;
    }

    public int getDistrictId() {
        return districtId;
    }

    public void setDistrictId(int districtId) {
        this.districtId = districtId;
    }

    public int getGnDivisionId() {
        return gnDivisionId;
    }

    public void setGnDivisionId(int gnDivisionId) {
        this.gnDivisionId = gnDivisionId;
    }

    public int getLocalAuthorityId() {
        return localAuthorityId;
    }

    public void setLocalAuthorityId(int localAuthorityId) {
        this.localAuthorityId = localAuthorityId;
    }

    public int getGeologicalTypeId() {
        return geologicalTypeId;
    }

    public void setGeologicalTypeId(int geologicalTypeId) {
        this.geologicalTypeId = geologicalTypeId;
    }

    public long getLandId() {
        return landId;
    }

    public void setLandId(long landId) {
        this.landId = landId;
    }

    public long getGrantId() {
        return grantId;
    }

    public void setGrantId(long grantId) {
        this.grantId = grantId;
    }

    public long getImmediateParentId() {
        return immediateParentId;
    }

    public void setImmediateParentId(long immediateParentId) {
        this.immediateParentId = immediateParentId;
    }

    public long getAlienationId() {
        return alienationId;
    }

    public void setAlienationId(long alienationId) {
        this.alienationId = alienationId;
    }

    public long getOccupierId() {
        return occupierId;
    }

    public void setOccupierId(long occupierId) {
        this.occupierId = occupierId;
    }

    public long getChildId() {
        return childId;
    }

    public void setChildId(long childId) {
        this.childId = childId;
    }

    public long getParentLandRefNumber() {
        return parentLandRefNumber;
    }

    public void setParentLandRefNumber(long parentLandRefNumber) {
        this.parentLandRefNumber = parentLandRefNumber;
    }

    public Contacts getContact() {
        return contact;
    }

    public void setContact(Contacts contact) {
        this.contact = contact;
    }

    public LeaseDetail getLeaseDetail() {
        return leaseDetail;
    }

    public void setLeaseDetail(LeaseDetail leaseDetail) {
        this.leaseDetail = leaseDetail;
    }

    public Mortgage getMortgage() {
        return mortgage;
    }

    public void setMortgage(Mortgage mortgage) {
        this.mortgage = mortgage;
    }

    public Land getNewLand() {
        return newLand;
    }

    public void setNewLand(Land newLand) {
        this.newLand = newLand;
    }

    public Schedule getSchedule() {
        return schedule;
    }

    public void setSchedule(Schedule schedule) {
        this.schedule = schedule;
    }

    public long getTempRefNo() {
        return tempRefNo;
    }

    public void setTempRefNo(long tempRefNo) {
        this.tempRefNo = tempRefNo;
    }

    public Double getHectare() {
        return hectare;
    }

    public void setHectare(Double hectare) {
        this.hectare = hectare;
    }

    public Double getAcre() {
        return acre;
    }

    public void setAcre(Double acre) {
        this.acre = acre;
    }

    public Double getRoods() {
        return roods;
    }

    public void setRoods(Double roods) {
        this.roods = roods;
    }

    public Double getPerches() {
        return perches;
    }

    public void setPerches(Double perches) {
        this.perches = perches;
    }

    public Double getLandExtent() {
        return landExtent;
    }

    public void setLandExtent(Double landExtent) {
        this.landExtent = landExtent;
    }

    public Double getMinExtent() {
        return minExtent;
    }

    public void setMinExtent(Double minExtent) {
        this.minExtent = minExtent;
    }

    public Double getMaxExtent() {
        return maxExtent;
    }

    public void setMaxExtent(Double maxExtent) {
        this.maxExtent = maxExtent;
    }

    public int getAlienationMethod() {
        return alienationMethod;
    }

    public void setAlienationMethod(int alienationMethod) {
        this.alienationMethod = alienationMethod;
    }

    public int getNicOrRegistrationNo() {
        return nicOrRegistrationNo;
    }

    public void setNicOrRegistrationNo(int nicOrRegistrationNo) {
        this.nicOrRegistrationNo = nicOrRegistrationNo;
    }

    public boolean isDeedTree() {
        return deedTree;
    }

    public void setDeedTree(boolean deedTree) {
        this.deedTree = deedTree;
    }

    public boolean isUpdateMode() {
        return updateMode;
    }

    public void setUpdateMode(boolean updateMode) {
        this.updateMode = updateMode;
    }

    public boolean isUpdateDetailForm() {
        return updateDetailForm;
    }

    public void setUpdateDetailForm(boolean updateDetailForm) {
        this.updateDetailForm = updateDetailForm;
    }

    public boolean isProgress() {
        return progress;
    }

    public void setProgress(boolean progress) {
        this.progress = progress;
    }

    public String getMortgageOrTransfer() {
        return mortgageOrTransfer;
    }

    public void setMortgageOrTransfer(String mortgageOrTransfer) {
        this.mortgageOrTransfer = mortgageOrTransfer;
    }

    public long[] getScheduleLandList() {
        return scheduleLandList;
    }

    public void setScheduleLandList(long[] scheduleLandList) {
        this.scheduleLandList = scheduleLandList;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getDsDivisionName() {
        return dsDivisionName;
    }

    public void setDsDivisionName(String dsDivisionName) {
        this.dsDivisionName = dsDivisionName;
    }

    public String getGnDivisionName() {
        return gnDivisionName;
    }

    public void setGnDivisionName(String gnDivisionName) {
        this.gnDivisionName = gnDivisionName;
    }

    public String getLocalAuthorityName() {
        return localAuthorityName;
    }

    public void setLocalAuthorityName(String localAuthorityName) {
        this.localAuthorityName = localAuthorityName;
    }

    public String getCurrentLandUsageName() {
        return currentLandUsageName;
    }

    public void setCurrentLandUsageName(String currentLandUsageName) {
        this.currentLandUsageName = currentLandUsageName;
    }

    public int getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(int scheduleId) {
        this.scheduleId = scheduleId;
    }

    public String getCalculateLeaseDate() {
        return calculateLeaseDate;
    }

    public void setCalculateLeaseDate(String calculateLeaseDate) {
        this.calculateLeaseDate = calculateLeaseDate;
    }

    public String getSearchText() {
        return searchText;
    }

    public void setSearchText(String searchText) {
        this.searchText = searchText;
    }

    public boolean isViewMode() {
        return viewMode;
    }

    public void setViewMode(boolean viewMode) {
        this.viewMode = viewMode;
    }

    public long getMILLIS_IN_A_DAY() {
        return MILLIS_IN_A_DAY;
    }
}